package com.deft.design.responsibility;

import java.time.LocalDateTime;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Hide丶love
 * @date 2022/05/11
 **/
public class AuthService {

    private static Map<String, LocalDateTime> AUTH_MAP = new ConcurrentHashMap<>();

    public static LocalDateTime authService(String uId, String orderId) {
        return AUTH_MAP.get(uId.concat(orderId));
    }

    public static void auth(String uId, String orderId) {
        AUTH_MAP.put(uId.concat(orderId), LocalDateTime.now());
    }
}
